<?php
/**
 * 		Copyright:SmartCome
 * 		  WebSite:www.SmartCome.com
 *             QQ:2811931192
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
global $_G;
 $dxksst = $_G['cache']['plugin']['dxksst_n'];
class plugin_dxksst_n {} 
class plugin_dxksst_n_forum extends plugin_dxksst_n{	
 function index_top(){  //Function
 global $_G;
 $dxksst = $_G['cache']['plugin']['dxksst_n'];
 $forbide_fid=unserialize($dxksst['forbide_fid']);
 $describe=$dxksst['describe']; $viewd=$dxksst['viewd'];
 $image_num=3;
 $fcolor=$dxksst['fcolor'];
 $bcolor=$dxksst['bcolor'];$type=$dxksst['type'];$width=$dxksst['width'];
 $mypic=$dxksst['mypic'];$mymain=$dxksst['mymain'];$border_top=$dxksst['border_top'];
 require_once libfile('getinfo','plugin/dxksst_n');
$lastarray=DB::fetch_first("select dateline from ".DB::table("dxksst_n"));
// var_dump($lastarray);
// die;
$lasttime=$lastarray['dateline'];
$ntime=strtotime(date("H:i:s"));$dtime=$ntime-$lasttime;
if($dtime>=$ltime){
DB::update("dxksst_n",array('dateline'=>$ntime));
$new_post=get_post_by_type($type,8,1,$forbide_fid);
 if(!$mypic){ 

 $pic=get_pic($image_num,$_G['setting']['attachurl']);}
 else{
	 $pic=array();
	 $mypic_arr=explode('##',$mypic);
       foreach($mypic_arr as $k=>$v){
	   $pic_info=explode('|',$v);
	    $pic[$k]['subject']=$pic_info[0];
		 $pic[$k]['url']=$pic_info[1];
		 $pic[$k]['attachment']=$pic_info[2];
	     }
       }  
  if(!$mymain){	
 $get_main_tid=get_pic(1,$_G['setting']['attachurl']);
 $first_main=get_first_main($get_main_tid[0]['tid'],$_G['setting']['attachurl']);}
 else{ $first_main=get_first_main($mymain,$_G['setting']['attachurl']);}
 $n_cache=array('new'=>$new_post,'pic'=>$pic,'first_main'=>$first_main);
require_once './source/function/function_cache.php'; 
writetocache('dxksst_n', getcachevars(array('dxksst_cache' => $n_cache))); 
 }
 else{
include_once DISCUZ_ROOT.'./data/sysdata/cache_dxksst_n.php';	 
$new_post=dxksst_cache("new");	$pic=dxksst_cache("pic");$first_main=dxksst_cache("first_main");}
include template('dxksst_n:dxksst');
return $return;
}//END Function
}
?>
